<template>
  <TableView
    ref="tableView"
    :table-attrs="{ api: getPage, descs: ['create_time'],
                    dicOptions: [] }"
    form-path="/urgent/urgentinfoForm/{id:-1}`"
    :search-model="searchForm"
    :delete-api="batchDelete"
    :toolbar-attrs="{ buttons: ['slot', { del: 'urgent_urgentinfo_del', create: 'urgent_urgentinfo_add' }] }">
    <template #toolbar-button="{ selectedRows }">
      <!-- 自定义按钮 -->
    </template>
    <template #columns>
      <TableColumn label="催办说明" prop="description"/>
      <TableColumn label="源业务ID" prop="sourceId"/>
      <TableColumn label="源业务类型" prop="sourceType"/>
      <TableColumn label="催办反馈状态：0:未反馈，1：已反馈" prop="status"/>
      <TableColumn label="催办反馈说明" prop="feedbackDescription"/>
      <TableColumn label="反馈时间" prop="feedbackTime"/>
    </template>
    <template #search-form>
      <!-- 搜索条件 -->
    </template>
  </TableView>
</template>

<script>
  import { mapState } from 'vuex'
  import { services } from '@/config'
  import { getPage, batchDelete } from '@/api/workItem/urgent'

  export default {
    name: 'Urgent',
    data() {
      return {
        searchForm: {
          id: '',
          unid: '',
          createId: '',
          createBy: '',
          createTime: '',
          deptId: '',
          deptFullname: '',
          updateBy: '',
          updateTime: '',
          description: '',
          sourceId: '',
          sourceType: '',
          status: '',
          feedbackDescription: '',
          feedbackTime: ''
        }
      }
    },
    computed: {
      services() {
        return services
      },
      ...mapState('user', ['permissions'])
    },
    methods: {
      getPage,
      batchDelete,
      //  导出excel
      exportExcel() {
        this.$downBlobFile(`${services.assetService}urgentinfo/export`, this.searchForm, 'urgent.xlsx')
      }
    }
  }
</script>
